Imports System
Imports System.Diagnostics
Imports System.IO
Public Class frmMain
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
    Friend WithEvents tabMain As System.Windows.Forms.TabControl
    Friend WithEvents tpgProcess As System.Windows.Forms.TabPage
    Friend WithEvents cmdRefresh As System.Windows.Forms.Button
    Friend WithEvents txtMachine As System.Windows.Forms.TextBox
    Friend WithEvents cmdEndProc As System.Windows.Forms.Button
    Friend WithEvents lvwProcesses As System.Windows.Forms.ListView
    Friend WithEvents lchCaption As System.Windows.Forms.ColumnHeader
    Friend WithEvents lchUser As System.Windows.Forms.ColumnHeader
    Friend WithEvents lchID As System.Windows.Forms.ColumnHeader
    Friend WithEvents RaMonitoring1 As WindowsControlLibrary1.RAMonitoring
    Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
    Friend WithEvents lchImage As System.Windows.Forms.ColumnHeader
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents NumericUpDown1 As System.Windows.Forms.NumericUpDown
    Friend WithEvents ShapeContainer1 As Microsoft.VisualBasic.PowerPacks.ShapeContainer
    Friend WithEvents RectangleShape1 As Microsoft.VisualBasic.PowerPacks.RectangleShape
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents WWWWWW As Microsoft.VisualBasic.PowerPacks.RectangleShape
    Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents cbEnable As System.Windows.Forms.ComboBox
    Friend WithEvents cbSize As System.Windows.Forms.ComboBox
    Friend WithEvents ColorDialog2 As System.Windows.Forms.ColorDialog
    Private components As System.ComponentModel.IContainer

    'Required by the Windows Form Designer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain))
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Panel1 = New System.Windows.Forms.Panel()
        Me.PictureBox1 = New System.Windows.Forms.PictureBox()
        Me.TabControl1 = New System.Windows.Forms.TabControl()
        Me.TabPage1 = New System.Windows.Forms.TabPage()
        Me.tabMain = New System.Windows.Forms.TabControl()
        Me.tpgProcess = New System.Windows.Forms.TabPage()
        Me.cmdRefresh = New System.Windows.Forms.Button()
        Me.txtMachine = New System.Windows.Forms.TextBox()
        Me.cmdEndProc = New System.Windows.Forms.Button()
        Me.lvwProcesses = New System.Windows.Forms.ListView()
        Me.lchCaption = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        Me.lchUser = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        Me.lchID = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        Me.RaMonitoring1 = New WindowsControlLibrary1.RAMonitoring()
        Me.TabPage2 = New System.Windows.Forms.TabPage()
        Me.cbSize = New System.Windows.Forms.ComboBox()
        Me.cbEnable = New System.Windows.Forms.ComboBox()
        Me.Button5 = New System.Windows.Forms.Button()
        Me.Label12 = New System.Windows.Forms.Label()
        Me.Button4 = New System.Windows.Forms.Button()
        Me.Label11 = New System.Windows.Forms.Label()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.NumericUpDown1 = New System.Windows.Forms.NumericUpDown()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.ShapeContainer1 = New Microsoft.VisualBasic.PowerPacks.ShapeContainer()
        Me.WWWWWW = New Microsoft.VisualBasic.PowerPacks.RectangleShape()
        Me.RectangleShape1 = New Microsoft.VisualBasic.PowerPacks.RectangleShape()
        Me.lchImage = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
        Me.ColorDialog1 = New System.Windows.Forms.ColorDialog()
        Me.ColorDialog2 = New System.Windows.Forms.ColorDialog()
        Me.Panel1.SuspendLayout()
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.TabControl1.SuspendLayout()
        Me.TabPage1.SuspendLayout()
        Me.tabMain.SuspendLayout()
        Me.tpgProcess.SuspendLayout()
        Me.TabPage2.SuspendLayout()
        CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.ForeColor = System.Drawing.SystemColors.ButtonHighlight
        Me.Label1.Location = New System.Drawing.Point(9, 8)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(39, 13)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Label1"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.ForeColor = System.Drawing.SystemColors.ButtonHighlight
        Me.Label2.Location = New System.Drawing.Point(9, 28)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(39, 13)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "Label2"
        '
        'Panel1
        '
        Me.Panel1.BackColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Panel1.Controls.Add(Me.PictureBox1)
        Me.Panel1.Controls.Add(Me.Label2)
        Me.Panel1.Controls.Add(Me.Label1)
        Me.Panel1.Location = New System.Drawing.Point(3, 3)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(501, 50)
        Me.Panel1.TabIndex = 2
        '
        'PictureBox1
        '
        Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
        Me.PictureBox1.Location = New System.Drawing.Point(401, 0)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(100, 50)
        Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.PictureBox1.TabIndex = 2
        Me.PictureBox1.TabStop = False
        Me.PictureBox1.Visible = False
        '
        'TabControl1
        '
        Me.TabControl1.Controls.Add(Me.TabPage1)
        Me.TabControl1.Controls.Add(Me.TabPage2)
        Me.TabControl1.Location = New System.Drawing.Point(3, 59)
        Me.TabControl1.Name = "TabControl1"
        Me.TabControl1.SelectedIndex = 0
        Me.TabControl1.Size = New System.Drawing.Size(501, 571)
        Me.TabControl1.TabIndex = 3
        '
        'TabPage1
        '
        Me.TabPage1.Controls.Add(Me.tabMain)
        Me.TabPage1.Controls.Add(Me.RaMonitoring1)
        Me.TabPage1.Location = New System.Drawing.Point(4, 22)
        Me.TabPage1.Name = "TabPage1"
        Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
        Me.TabPage1.Size = New System.Drawing.Size(493, 545)
        Me.TabPage1.TabIndex = 0
        Me.TabPage1.Text = "TabPage1"
        Me.TabPage1.UseVisualStyleBackColor = True
        '
        'tabMain
        '
        Me.tabMain.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
            Or System.Windows.Forms.AnchorStyles.Left) _
            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.tabMain.Controls.Add(Me.tpgProcess)
        Me.tabMain.Location = New System.Drawing.Point(-4, 272)
        Me.tabMain.Name = "tabMain"
        Me.tabMain.SelectedIndex = 0
        Me.tabMain.Size = New System.Drawing.Size(501, 277)
        Me.tabMain.TabIndex = 2
        '
        'tpgProcess
        '
        Me.tpgProcess.Controls.Add(Me.cmdRefresh)
        Me.tpgProcess.Controls.Add(Me.txtMachine)
        Me.tpgProcess.Controls.Add(Me.cmdEndProc)
        Me.tpgProcess.Controls.Add(Me.lvwProcesses)
        Me.tpgProcess.Location = New System.Drawing.Point(4, 22)
        Me.tpgProcess.Name = "tpgProcess"
        Me.tpgProcess.Size = New System.Drawing.Size(493, 251)
        Me.tpgProcess.TabIndex = 1
        Me.tpgProcess.Text = "Processes"
        '
        'cmdRefresh
        '
        Me.cmdRefresh.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.cmdRefresh.Location = New System.Drawing.Point(309, 225)
        Me.cmdRefresh.Name = "cmdRefresh"
        Me.cmdRefresh.Size = New System.Drawing.Size(84, 24)
        Me.cmdRefresh.TabIndex = 3
        Me.cmdRefresh.Text = "Refresh"
        '
        'txtMachine
        '
        Me.txtMachine.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.txtMachine.Location = New System.Drawing.Point(213, 225)
        Me.txtMachine.Name = "txtMachine"
        Me.txtMachine.ReadOnly = True
        Me.txtMachine.Size = New System.Drawing.Size(88, 20)
        Me.txtMachine.TabIndex = 2
        Me.txtMachine.Text = "[machinename]"
        '
        'cmdEndProc
        '
        Me.cmdEndProc.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.cmdEndProc.Location = New System.Drawing.Point(401, 225)
        Me.cmdEndProc.Name = "cmdEndProc"
        Me.cmdEndProc.Size = New System.Drawing.Size(84, 24)
        Me.cmdEndProc.TabIndex = 1
        Me.cmdEndProc.Text = "End Process"
        '
        'lvwProcesses
        '
        Me.lvwProcesses.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
            Or System.Windows.Forms.AnchorStyles.Left) _
            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.lvwProcesses.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.lchCaption, Me.lchUser, Me.lchID})
        Me.lvwProcesses.FullRowSelect = True
        Me.lvwProcesses.GridLines = True
        Me.lvwProcesses.Location = New System.Drawing.Point(8, 8)
        Me.lvwProcesses.Name = "lvwProcesses"
        Me.lvwProcesses.Size = New System.Drawing.Size(477, 209)
        Me.lvwProcesses.TabIndex = 0
        Me.lvwProcesses.UseCompatibleStateImageBehavior = False
        Me.lvwProcesses.View = System.Windows.Forms.View.Details
        '
        'lchCaption
        '
        Me.lchCaption.Text = "Caption"
        Me.lchCaption.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        Me.lchCaption.Width = 200
        '
        'lchUser
        '
        Me.lchUser.Text = "Responding"
        Me.lchUser.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        Me.lchUser.Width = 100
        '
        'lchID
        '
        Me.lchID.Text = "Session ID"
        Me.lchID.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        '
        'RaMonitoring1
        '
        Me.RaMonitoring1.BackColor = System.Drawing.Color.Black
        Me.RaMonitoring1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
        Me.RaMonitoring1.ForeColor = System.Drawing.Color.White
        Me.RaMonitoring1.GraphicType = WindowsControlLibrary1.RAMonitoring.graphic.Graph
        Me.RaMonitoring1.Location = New System.Drawing.Point(-4, -13)
        Me.RaMonitoring1.MinimumSize = New System.Drawing.Size(500, 254)
        Me.RaMonitoring1.Name = "RaMonitoring1"
        Me.RaMonitoring1.RealTimeMonitoring = False
        Me.RaMonitoring1.SelectLayoutRAM = WindowsControlLibrary1.RAMonitoring.layoutRAM.All
        Me.RaMonitoring1.Size = New System.Drawing.Size(500, 270)
        Me.RaMonitoring1.SizeType = WindowsControlLibrary1.RAMonitoring.showSize.kiloBytes
        Me.RaMonitoring1.TabIndex = 3
        '
        'TabPage2
        '
        Me.TabPage2.Controls.Add(Me.cbSize)
        Me.TabPage2.Controls.Add(Me.cbEnable)
        Me.TabPage2.Controls.Add(Me.Button5)
        Me.TabPage2.Controls.Add(Me.Label12)
        Me.TabPage2.Controls.Add(Me.Button4)
        Me.TabPage2.Controls.Add(Me.Label11)
        Me.TabPage2.Controls.Add(Me.Button2)
        Me.TabPage2.Controls.Add(Me.Label10)
        Me.TabPage2.Controls.Add(Me.Label9)
        Me.TabPage2.Controls.Add(Me.Label8)
        Me.TabPage2.Controls.Add(Me.NumericUpDown1)
        Me.TabPage2.Controls.Add(Me.Label7)
        Me.TabPage2.Controls.Add(Me.Label6)
        Me.TabPage2.Controls.Add(Me.Label5)
        Me.TabPage2.Controls.Add(Me.Label4)
        Me.TabPage2.Controls.Add(Me.Label3)
        Me.TabPage2.Controls.Add(Me.ShapeContainer1)
        Me.TabPage2.Location = New System.Drawing.Point(4, 22)
        Me.TabPage2.Name = "TabPage2"
        Me.TabPage2.Padding = New System.Windows.Forms.Padding(3)
        Me.TabPage2.Size = New System.Drawing.Size(493, 545)
        Me.TabPage2.TabIndex = 1
        Me.TabPage2.Text = "TabPage2"
        Me.TabPage2.UseVisualStyleBackColor = True
        '
        'cbSize
        '
        Me.cbSize.FormattingEnabled = True
        Me.cbSize.Items.AddRange(New Object() {"KiloByte", "MegaByte", "GigaByte"})
        Me.cbSize.Location = New System.Drawing.Point(108, 199)
        Me.cbSize.Name = "cbSize"
        Me.cbSize.Size = New System.Drawing.Size(121, 21)
        Me.cbSize.TabIndex = 23
        '
        'cbEnable
        '
        Me.cbEnable.FormattingEnabled = True
        Me.cbEnable.Items.AddRange(New Object() {"Enable", "Disable"})
        Me.cbEnable.Location = New System.Drawing.Point(91, 103)
        Me.cbEnable.Name = "cbEnable"
        Me.cbEnable.Size = New System.Drawing.Size(121, 21)
        Me.cbEnable.TabIndex = 22
        '
        'Button5
        '
        Me.Button5.Location = New System.Drawing.Point(108, 283)
        Me.Button5.Name = "Button5"
        Me.Button5.Size = New System.Drawing.Size(58, 23)
        Me.Button5.TabIndex = 21
        Me.Button5.Text = "Browse"
        Me.Button5.UseVisualStyleBackColor = True
        '
        'Label12
        '
        Me.Label12.AutoSize = True
        Me.Label12.Location = New System.Drawing.Point(24, 284)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(55, 13)
        Me.Label12.TabIndex = 20
        Me.Label12.Text = "Text Color"
        '
        'Button4
        '
        Me.Button4.Location = New System.Drawing.Point(108, 254)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(58, 23)
        Me.Button4.TabIndex = 19
        Me.Button4.Text = "Browse"
        Me.Button4.UseVisualStyleBackColor = True
        '
        'Label11
        '
        Me.Label11.AutoSize = True
        Me.Label11.Location = New System.Drawing.Point(24, 256)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(59, 13)
        Me.Label11.TabIndex = 18
        Me.Label11.Text = "Back Color"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(108, 224)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(58, 23)
        Me.Button2.TabIndex = 17
        Me.Button2.Text = "Browse"
        Me.Button2.UseVisualStyleBackColor = True
        '
        'Label10
        '
        Me.Label10.AutoSize = True
        Me.Label10.Location = New System.Drawing.Point(24, 229)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(65, 13)
        Me.Label10.TabIndex = 13
        Me.Label10.Text = "Background"
        '
        'Label9
        '
        Me.Label9.AutoSize = True
        Me.Label9.Location = New System.Drawing.Point(24, 201)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(44, 13)
        Me.Label9.TabIndex = 12
        Me.Label9.Text = "Size On"
        '
        'Label8
        '
        Me.Label8.AutoSize = True
        Me.Label8.Location = New System.Drawing.Point(21, 173)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(65, 13)
        Me.Label8.TabIndex = 11
        Me.Label8.Text = "RAM Option"
        '
        'NumericUpDown1
        '
        Me.NumericUpDown1.Location = New System.Drawing.Point(92, 50)
        Me.NumericUpDown1.Name = "NumericUpDown1"
        Me.NumericUpDown1.Size = New System.Drawing.Size(100, 20)
        Me.NumericUpDown1.TabIndex = 9
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label7.Location = New System.Drawing.Point(198, 48)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(31, 25)
        Me.Label7.TabIndex = 5
        Me.Label7.Text = "%"
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.Location = New System.Drawing.Point(31, 57)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(55, 13)
        Me.Label6.TabIndex = 3
        Me.Label6.Text = "Limit RAM"
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.Location = New System.Drawing.Point(31, 111)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(40, 13)
        Me.Label5.TabIndex = 2
        Me.Label5.Text = "Enable"
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.Location = New System.Drawing.Point(21, 19)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(62, 13)
        Me.Label4.TabIndex = 1
        Me.Label4.Text = "Alert Option"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(21, 19)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(0, 13)
        Me.Label3.TabIndex = 0
        '
        'ShapeContainer1
        '
        Me.ShapeContainer1.Location = New System.Drawing.Point(3, 3)
        Me.ShapeContainer1.Margin = New System.Windows.Forms.Padding(0)
        Me.ShapeContainer1.Name = "ShapeContainer1"
        Me.ShapeContainer1.Shapes.AddRange(New Microsoft.VisualBasic.PowerPacks.Shape() {Me.WWWWWW, Me.RectangleShape1})
        Me.ShapeContainer1.Size = New System.Drawing.Size(487, 539)
        Me.ShapeContainer1.TabIndex = 10
        Me.ShapeContainer1.TabStop = False
        '
        'WWWWWW
        '
        Me.WWWWWW.Location = New System.Drawing.Point(4, 161)
        Me.WWWWWW.Name = "WWWWWW"
        Me.WWWWWW.Size = New System.Drawing.Size(476, 151)
        '
        'RectangleShape1
        '
        Me.RectangleShape1.Location = New System.Drawing.Point(4, 9)
        Me.RectangleShape1.Name = "RectangleShape1"
        Me.RectangleShape1.Size = New System.Drawing.Size(477, 139)
        '
        'lchImage
        '
        Me.lchImage.Text = "Image Name"
        Me.lchImage.Width = 100
        '
        'Timer1
        '
        Me.Timer1.Interval = 1
        '
        'OpenFileDialog1
        '
        Me.OpenFileDialog1.FileName = "OpenFileDialog1"
        '
        'frmMain
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(509, 633)
        Me.Controls.Add(Me.TabControl1)
        Me.Controls.Add(Me.Panel1)
        Me.MaximizeBox = False
        Me.Name = "frmMain"
        Me.Text = "RAM"
        Me.Panel1.ResumeLayout(False)
        Me.Panel1.PerformLayout()
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.TabControl1.ResumeLayout(False)
        Me.TabPage1.ResumeLayout(False)
        Me.tabMain.ResumeLayout(False)
        Me.tpgProcess.ResumeLayout(False)
        Me.tpgProcess.PerformLayout()
        Me.TabPage2.ResumeLayout(False)
        Me.TabPage2.PerformLayout()
        CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Dim limit As Integer = 0

    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        RaMonitoring1.startMonitoring()

        cbEnable.SelectedIndex = 1
        cbSize.SelectedIndex = 0

        txtMachine.Text = RaMonitoring1.getPCname
        Call FillList(txtMachine.Text)
        Label1.Text = RaMonitoring1.getOS
        Label2.Text = RaMonitoring1.getProcessor
        TabPage1.Text = "Task Manager"
        TabPage2.Text = "Options"


    End Sub

    Sub FillList(ByVal MachineName As String)
        Dim Prc() As Process
        Dim i As Integer
        Dim lvwP As ListViewItem
        Try
            lvwProcesses.Items.Clear()
            Prc = Process.GetProcesses(MachineName)

            For i = 0 To UBound(Prc)
                lvwP = lvwProcesses.Items.Add(Prc(i).ProcessName.ToUpper)

                If MachineName <> System.Environment.MachineName Then
                    lvwP.SubItems.Add("Unavailable...")
                    lvwP.SubItems.Add("Unavailable...")
                    lvwP.SubItems.Add(Prc(i).Id)
                Else
                    lvwP.SubItems.Add(Prc(i).MainWindowTitle)
                    lvwP.SubItems.Add(Prc(i).Responding)
                    lvwP.SubItems.Add(Prc(i).Id)
                End If

            Next
        Catch
            lvwProcesses.Items.Add("Error enumerating items...")
        End Try
    End Sub

    Private Sub cmdEndProc_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim Prc As Process

        If txtMachine.Text = System.Environment.MachineName.ToString Then
            Try
                Prc = Process.GetProcessById(lvwProcesses.SelectedItems(0).SubItems(3).Text)
                Prc.Kill()
                lvwProcesses.Items.Remove(lvwProcesses.SelectedItems.Item(0))
            Catch
                MessageBox.Show("Could not close process, " & Err.Description, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            End Try
        Else
            MessageBox.Show("You cannot close processes on a remote machine, only view them!", "Error:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End If
    End Sub

    Private Sub cmdRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        txtMachine.Text = txtMachine.Text.ToUpper
        Call FillList(txtMachine.Text)
    End Sub




    Private Sub Timer1_Tick_1(sender As Object, e As EventArgs) Handles Timer1.Tick

        If (RaMonitoring1.getMemoryPercentage) >= limit Then
            My.Computer.Audio.Play(My.Resources.s, AudioPlayMode.Background)

            Timer1.Interval = 4000
            PictureBox1.Visible = True
        ElseIf (RaMonitoring1.getMemoryPercentage) < limit Then

            Timer1.Interval = 1
            PictureBox1.Visible = False
        End If
    End Sub


    Private Sub Button1_Click(sender As Object, e As EventArgs)
        Timer1.Start()
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs)
        My.Computer.Audio.Stop()
        Timer1.Stop()
        PictureBox1.Visible = False
    End Sub

    Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
        limit = NumericUpDown1.Value
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        OpenFileDialog1.Filter = "jpg files (*.jpg)|*.jpg|png files (*.png)|*.png"
        If OpenFileDialog1.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
            RaMonitoring1.BackgroundImage = Image.FromFile(OpenFileDialog1.FileName)
        End If


    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click

        If ColorDialog2.ShowDialog <> Windows.Forms.DialogResult.Cancel Then

            RaMonitoring1.BackColor = ColorDialog2.Color
        Else

            RaMonitoring1.BackColor = RaMonitoring1.BackColor
        End If
    End Sub

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

        If ColorDialog1.ShowDialog <> Windows.Forms.DialogResult.Cancel Then

            RaMonitoring1.ForeColor = ColorDialog1.Color
        Else
            RaMonitoring1.ForeColor = RaMonitoring1.ForeColor
        End If
    End Sub

    Private Sub cbEnable_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbEnable.SelectedIndexChanged
        Dim a As String = cbEnable.Text

        If a = "Enable" Then
            Timer1.Start()
            Timer1.Interval = 1
        Else
            My.Computer.Audio.Stop()
            Timer1.Stop()
            PictureBox1.Visible = False
        End If
    End Sub

    Private Sub cbSize_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbSize.SelectedIndexChanged
        Dim a As String = cbSize.Text
        If a = "KiloByte" Then
            RaMonitoring1.SizeType = WindowsControlLibrary1.RAMonitoring.showSize.kiloBytes
        ElseIf a = "MegaByte" Then
            RaMonitoring1.SizeType = WindowsControlLibrary1.RAMonitoring.showSize.megaBytes
        Else
            RaMonitoring1.SizeType = WindowsControlLibrary1.RAMonitoring.showSize.gigaBytes
        End If
    End Sub

    Private Sub cmdRefresh_Click_1(sender As Object, e As EventArgs) Handles cmdRefresh.Click
        txtMachine.Text = txtMachine.Text.ToUpper
        Call FillList(txtMachine.Text)
    End Sub

    Private Sub cmdEndProc_Click_1(sender As Object, e As EventArgs) Handles cmdEndProc.Click
        Dim Prc As Process

        If txtMachine.Text = System.Environment.MachineName.ToString Then
            Try
                Prc = Process.GetProcessById(lvwProcesses.SelectedItems(0).SubItems(3).Text)
                Prc.Kill()
                lvwProcesses.Items.Remove(lvwProcesses.SelectedItems.Item(0))
            Catch
                MessageBox.Show("Could not close process, " & Err.Description, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            End Try
        Else
            MessageBox.Show("You cannot close processes on a remote machine, only view them!", "Error:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End If
    End Sub


End Class
